#include "../stdafx.h"
#include "KeyID.h"

#include <map>
#include <string>

using namespace std;

namespace KeyID{
	static map<UINT, wstring> nsmap;
	static map<wstring, UINT> snmap;
	static UINT cmdID = 10000;



	UINT GetID(wstring key){
		UINT n = snmap[key];
		if(n == 0){
			snmap[key] = cmdID;
			nsmap[cmdID] = key;
			n = cmdID;
			++cmdID;
		}
		return n;
	}
	wstring GetKey(UINT id){
		return nsmap[id];
	}
};
